package server.entity;

import java.awt.Rectangle;
import java.awt.geom.Line2D;

public class Paddle extends Rectangle {

	private static final long serialVersionUID = -6856988994347611320L;
	private int playerId;
	
	public Paddle(int playerId, int x, int y, int width, int height) {
		setBounds(x, y, width, height);
		this.playerId = playerId;
	}
	
	public int getPlayerId() {
		return playerId;
	}
	
	public Line2D getCollisionSide() {
		if(playerId == 1) {
			return new Line2D.Double(getX() + getWidth(), getY(), getX() + getWidth(), getY() + getHeight());
		} else {
			return new Line2D.Double(getX(), getY(), getX(), getY() + getHeight());
		}
	}

}
